package domain;

import org.springframework.format.annotation.DateTimeFormat;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Product {
    private int id;//id
    private String productNum;//产品编号
    private String productName;//产品名称
    private String goCity;//出发城市
    @DateTimeFormat(pattern = "yyyy年MM月dd日")
    private Date  goTime;//出发时间
    private double price;//价格
    private int status;//状态  0:关闭    1：开启
    private String information;//详细信息
    private String img;

    private String goTimeStr;//前端显示的出发时间
    private String statusStr;//前端显示的状态


    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getGoTimeStr() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy年MM月dd日");
        return goTime==null?"":df.format(goTime);
    }

    public void setGoTimeStr(String goTimeStr) {
        this.goTimeStr = goTimeStr;
    }

    public String getStatusStr() {
        return status == 0?"关闭":"开启";
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getProductNum() {
        return productNum;
    }

    public void setProductNum(String productNum) {
        this.productNum = productNum;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getGoCity() {
        return goCity;
    }

    public void setGoCity(String goCity) {
        this.goCity = goCity;
    }

    public Date getGoTime() {
        return goTime;
    }

    public void setGoTime(Date goTime) {
        this.goTime = goTime;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getInformation() {
        return information;
    }

    public void setInformation(String information) {
        this.information = information;
    }
}
